package com.nbsaas.boot.common.rest.convert;

import com.nbsaas.boot.common.data.entity.OperationLog;
import com.nbsaas.boot.common.api.domain.simple.OperationLogSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* -列表对象转换器
*/

public class OperationLogSimpleConvert implements Converter<OperationLogSimple, OperationLog> {




@Override
public OperationLogSimple convert(OperationLog source) {
    OperationLogSimple result = new OperationLogSimple();


               try {
                   if(source.getCreator()!=null){
                       result.setCreator(source.getCreator().getId());
                   }
                } catch (Exception ignored) { }

                result.setIp(source.getIp());

                try {
                    if(source.getCreator()!=null){
                        result.setCreatorName(source.getCreator().getName());
                    }
                } catch (Exception ignored) { }

                result.setMethodName(source.getMethodName());
                result.setClassName(source.getClassName());
                result.setId(source.getId());
                result.setParams(source.getParams());
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}